<?php error_reporting(0); ?>

<!DOCTYPE html>
<html>

<head>
	<meta http-equiv="content-type" content="text/html" charset="utf-8" />	

	<script type="text/javascript" src="./js/libs/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="./js/libs/jquery-ui.js"></script>
	<link rel="stylesheet" type="text/css" href="./js/libs/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="./css/index.css">
	<link rel="stylesheet" type="text/css" href="./css/login.css">
	<script type="text/javascript" src="./js/common.js"></script>
	<title>SCUcalender</title>
</head>

<body>
	<div id="header">
		<ul>
			<li><a href="./index.php"><img src="img/scu.png" /></a></li>
			<li>SCUcalender</li>
			<li><?php session_start();if($_SESSION['username']) {echo ($_SESSION['username'])."<a href=\"./logout.php\"><button>注销</button></a>";}?></li>
		</ul>
	</div>
	<br />

<?php
	session_start();
	if ((!isset($_SESSION['username']) || $_SESSION['username'] == '')) {
		if(basename($_SERVER['PHP_SELF']) != 'login.php') {
			echo "<div class='submit'><a href=\"./login.php\"><button>登录</button></a></div>";
		}
	}
	else {
		echo "<div class='submit'><a href=\"./student_table.php\"><button>我的课表</button></a></div>";
		echo "<div class='submit'><a href=\"./ics.php\"><button>下载课表</button></a></div>'";
		if(basename($_SERVER['PHP_SELF']) != 'change_pwd.php') {
			echo "<div class='submit'><a href=\"./change_pwd.php\"><button>修改密码</button></a></div>'";
		}
	}
?>
	<div id="form-sheet">
		<form action='./search.php' method='GET'>
			<input type='text' name='keyword' id='keyword' class='search-field' placeholder='请输入教师名或课程名查询课程信息' /><button class='search-submit' type='submit'>搜索课程信息</button>
		</form>
		
		<form action='./teacher_table.php' method='GET'>
			<input type='text' name='teacher' id='teacher' class='search-field' placeholder='请输入教师名查询教师课表' /><button class='search-submit' type='submit'>获取教师课表</button>
		</form>
	</div>